import { IsNumber } from 'class-validator';
import { PartialType } from '@nestjs/mapped-types';
import { Paging } from '../../common/common.dto';

export class SettingDto {
  @IsNumber(
    {
      allowNaN: false,
      allowInfinity: false,
    },
    {
      message: JSON.stringify({ message: '开始时间值错误', code: 5000 }),
    },
  )
  readonly startTime?: number;

  @IsNumber(
    {
      allowNaN: false,
      allowInfinity: false,
    },
    {
      message: JSON.stringify({ message: '结束时间值错误', code: 5001 }),
    },
  )
  readonly endTime?: number;

  @IsNumber(
    {
      allowNaN: false,
      allowInfinity: false,
    },
    {
      message: JSON.stringify({ message: '状态值错误', code: 5002 }),
    },
  )
  readonly isActive?: number;
}

export class QueryCandidateDto extends PartialType(Paging) {
  readonly isActive?: number;
}
